1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a program by which an image processing, such as an image size-change processing or so can be performed on digital image data of an original image efficiently.
2. Description of the Related Art
Usually, with an image processing apparatus, such as a copying machine or a printer, an image is output or printed out after being changed in its size in many cases. For example, when printing out a photographic image taken with a digital camera via a printer, generally a change in size into an image suitable for the size of a printing paper may be performed.
A case where magnification processing (or enlargement processing) in which the number of pixels of an original image is increased will now be discussed, for example. For example, as shown in FIG. 1A, an original image which has an outline containing an edge portion of a 45-degree oblique line will now be discussed. In this case, it is assumed that this original image is increased twice in each dimension. That is, each pixel is multiplied into 4 pixels with the pixel value unchanged, for example. In this case, a black pixel ‘a’ of this figure turns into black pixels a1, a2, a3, and a4 as shown in FIG. 1B. In this case, a so-called jaggy phenomenon well-known occurs in a conspicuous manner as shown in FIG. 1B in which the edge part includes a shape like ‘stair steps’.
In order to solve this problem, a so-called jaggy processing may be applied. By this jaggy processing, a jaggy phenomenon such as that mentioned above becomes less conspicuous. FIG. 2 shows a flow chart according to this scheme.
As shown, after inputting an image before a magnification process in this case (Step S1), predetermined image processing is performed (Step S2). In this case, without applying the scheme of simply multiplying each pixel into 4 pixels as mentioned above, a certain operation is performed by using pixel values of pixels surrounding the relevant pixel. Thereby, for example, from the original pixel ‘a’ shown in FIG. 1A, four pixels a1, a2, a3 and a4 are produced as shown in FIG. 1C. As shown, in this scheme, the pixel ‘a’ is not simply multiplied into four pixels each being a black pixel, but the thus-produced pixels a1, a2, a3 and a4 are those of one white pixel and other three black pixels. As can be seen clearly from FIGS. 1B and 1C, the jaggy phenomenon becomes less conspicuous accordingly. Thus, the edge part of 45-degree slant becomes smoother as shown in FIG. 1C (i.e., the above-mentioned ‘stair steps’ are made finer).
Such a jaggy processing which enables the above-mentioned operation is disclosed, for example, by Japanese laid-open patent application No. 2001-188900 filed by the present applicant.
Thus, it is possible by performing jaggy processing, to improve the quality of image of after the magnification. That is, originally the relevant 45-degree slant part is a smooth straight line of in a smooth photographic subject with a 45-degree slant, and, as a result of being taken by a digital camera, such a stair-like jaggy phenomenon occurs due to a quantization error in the digital camera according to a resolution performance thereof. Therefore, it can be said that, when the relevant image is expanded or magnified, the state shown in FIG. 1C is more similar to the original subject image than the state shown in FIG. 1B.
However, in case such a jaggy processing is performed as mentioned above, a certain operation or calculation should be performed for each pixel with reference to peripheral pixels as mentioned above. Accordingly, an extra processing time is needed for processing each pixel. Thereby, a considerable time is needed for processing the entire image consequently.
For a user, it is preferable that an image which expresses a photographic subject more precisely through such jaggy processing. However, in many case, a user also needs a reduction in the processing time taken. That is, in some case, for a user, no jaggy processing should be performed in case a very long processing time is needed therefor even when a resulting printed matter shows a somewhat serious jaggy phenomenon. Especially in a case where the size of original image data is very large, i.e., the data amount thereof is very large, a very long time may be required for the jaggy processing throughout the given image data accordingly. Such a condition may not be necessarily preferable for a user.
In order to solve this problem, a scheme disclosed by Japanese laid-open patent application No. 5-233789 may be applied. According to this scheme, as shown in FIG. 3, a magnification way is selected from among a way of Step S13 or a way of Step S15 for an original image according to a result of comparison of the data amount of the original image with a predetermined reference value (Step S11). However, according to this art, there is a possibility that a difference arises remarkably depending on which of the ways is thus selected from the above-mentioned comparison with respect to a required data processing time, an image quality of the thus-processed image, or so. When the data amount of the original image is in accident very near the above-mentioned reference value, the way to be selected differs according to a very small difference in the data amount, and, then, the required data processing time and/or the image quality of the thus-processed image may differ remarkably.
Such a tendency may become more remarkable with a recent increase in the resolution performance of the image input device or increase in the required image quality. That is, since thereby it becomes possible to input an original image with a large image data size at a high resolution, the data amount to be processed in size-change processing, such as a magnification, a size-reduction, etc. increases accordingly. For this reason, the time required to process the data concerned increases accordingly. When the time needed for the image data processing as a result becomes much larger, a situation which does not necessarily match a requirement of a user may occur with respect to a time which the user can permit.
Similar problem may occur not only in a case of image size magnification but also in a case of image size reduction for digitized image data. In a case of image size reduction, in terms of required data processing time, a way of image size reduction employing, so-called, a simple thinning-out processing may be advantageous. In this scheme, the number of pixels is simply reduced. However, in such a scheme, in which no special concern is made as to a color of each pixel, as to what a relation relating pixels have, or so, essential drawing information such as a thin line drawing may be lost in some case.
Such a problematic situation will now be described in a specific example. For example, a case where an original image of 8×8 pixel configuration shown in FIG. 4A is reduced to a half in size, or a ¼ in area, will now be discussed. In this case, a predetermined one is selected from among each unit of 4 pixels of 2×2, for example, such as those enclosed by broken lines in FIG. 4A, while the other three pixels are ignored. In order to simplify the description, it is assumed that, in an original image shown in FIG. 4A, pixels of halftone dots represent black pixels while pixels of blank squares represent white pixels. That is, as shown, the original image has a horizontal stripe pattern.
In this case, it is also assumed that a law or an algorithm is provided by which the top-left pixel is selected from among the four pixels of each 2×2 pixel unit in size-reduction process. As a result, the thus-size-reduced image is that shown in FIG. 4B. As shown, the image resulting becomes completely different from that before being thus processed shown in FIG. 4A. That is, the horizontal stripe pattern is lost and an entirely black painted image occurs.
FIGS. 5A and 5B shows another example in which the above-mentioned same law/algorithm of size reduction is applied to an original image which is almost the same as that in the example of FIG. 4A. In this case, as shown, on the contrary, the resulting image is of an entirely white painted image. Thus, in case the simple thinning-out-type size reduction is performed, the image resulting becomes completely different in impression only due to a difference in position of image pattern of the original image.
When reducing an image, unlike a case of magnification, the information amount of pixels is reduced absolutely, and, thereby, basically it is not possible to secure 100% of the original data. Accordingly, it is necessary to devise a certain special idea by which the outline of an original image is maintained for the purpose of substantially improving the image quality even through size reduction processing.
FIGS. 6A through 6C illustrate another example of a case the above-mentioned simple thinning-out-type size reduction scheme is applied, and a way of maintaining the outline of an original image. When the size reduction processing according to the simple thinning-out scheme is applied to an original image shown in FIG. 6A, a size-reduced image shown in FIG. 6B is obtained, for example, in which the outline of the original image is clearly damaged. In contrast thereto, a special idea may be applied in which each pixel after reduction is determined with reference to surrounding pixels of a target pixel before reduction. Thereby, a reduced image shown in FIG. 6C is obtained. In FIG. 6C, by utilizing intermediate image tone levels in addition to completely black and white pixels, the outline of the original image is maintained to a certain amount even in the reduced image, as shown.
Thus, by employing a technique of determining a pixel value after reduction processing using information of surrounding pixels, it is possible to maintain the impression of an original image to a some extent even after the reduction processing. However, when such a certain type of advanced image processing is performed and thus a loss of the original image data is substantially avoided as much as possible, the amount of processing required increases also in the reduction processing, and the processing speed will be degraded as in the case of above-mentioned magnification processing as a result.
The above-described art of the Japanese laid-open patent application No. 5-233789 may also be used as a way of solving of the above-mentioned problem, in which, the data amount/size of the original image is compared with a predetermined reference value, and according to the comparison result, a way of image size change applied is selected. However, also in the case of size reduction, with this technology, a remarkable difference may occur in a resulting image quality due to a difference in the way of processing currently selected, as mentioned with reference to FIGS. 6A, 6B and 6C. Also, the same problem as that in a case of image magnification may occur such that the data processing time required and/or data quality obtained differs remarkably due to a small difference in the original data amount in case the data amount is very close to the predetermined reference value.